package com.springboot.test.web.app;

import com.springboot.test.common.response.Response;
import com.springboot.test.service.GoodsService;
import com.springboot.test.service.result.GoodsDetailResult;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("app/goods/detail")
public class GoodsDetailController {

    @Resource
    private GoodsService goodsService;

    @GetMapping("queryOne")
    public Response<GoodsDetailResult> queryOne(String goodsCode){
       return Response.success(goodsService.detailByCode(goodsCode));
    }
}
